<!--
 * @Author: 蔡继周
 * @Date: 2021-11-16 15:52:03
 * @LastEditTime : 2021-12-09 13:25:06
 * @LastEditors  : Shaquille.Cai
 * @Description: I have to do something...
 * @FilePath     : \\vue3-admin-with-blog\\src\\components\\FormTep\\itemView\\DateTimePickerMoudel.vue
-->

<template>
  <el-form-item
    :label="column.title ? column.title + '：' : ''"
    :prop="column.name"
    :rules="rules"
  >
    <el-date-picker
      style="width: 100%"
      v-model="value"
      :placeholder="`请输入${column.title}`"
      v-bind="column.definProps"
    />
  </el-form-item>
</template>
<script setup>
import { computed } from "vue";
import useComputedRule from "./../hooks/useComputedRule";
const emit = defineEmits(["update:model"]);
const props = defineProps({
  column: {
    type: Object,
    default: () => {},
  },
  model: {
    type: String,
    default: "",
  },
});
const { rules } = useComputedRule(props);
const value = computed({
  get: () => props.model,
  set: (val) => emit("update:model", val),
});
</script>
